package com.example.bootdemo.rabbitmq;

import com.example.bootdemo.configuration.RabbitMqConfiguration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
@RabbitListener(queues = {RabbitMqConfiguration.XIAOMI_QUEUE,RabbitMqConfiguration.HUAWEI_QUEUE,RabbitMqConfiguration.IPHONE_QUEUE})
public class TopicMessageConsumer {

    private Logger logger = LoggerFactory.getLogger(TopicMessageConsumer.class);

    @RabbitHandler
    public void consumeMessage(String message){

        logger.info("接收到主题式消息："+message);
    }
}
